﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using QuanLyThuVien.Supporter;
using QuanLyThuVien.GUI;

namespace QuanLyThuVien
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new GUIKetNoiServer());
            if (DatabaseManager.MasterConnection != null && DatabaseManager.MasterConnection.Open())
            {
                DatabaseManager.MasterConnection.Close();
                Application.Run(new GUIKetNoiCSDL());
                if (DatabaseManager.DbConnection != null && DatabaseManager.DbConnection.Open())
                {
                    DatabaseManager.DbConnection.Close();
                    Application.Run(new GUIQuanLyThuVien());
                }
            }

        }
    }
}
